package com.estranger.www.bean.function;

import org.springframework.context.ApplicationEvent;

/**
 * @Created by michangtao
 * @Date 2021/11/4 14:30
 * @Description
 */
public class OriginalEvent<T> extends ApplicationEvent {

    private T data;

    private IProcessor processor;

    public OriginalEvent(Object source, T data, IProcessor processor) {
        super(source);
        this.data = data;
        this.processor = processor;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public IProcessor getProcessor() {
        return processor;
    }

    public void setProcessor(IProcessor processor) {
        this.processor = processor;
    }

    @FunctionalInterface
    public interface IProcessor{
        void deal(Object data);
    }
}
